package cn.tju.leavingsystem.dao;

import cn.tju.leavingsystem.entity.LeavingApplication;

import java.util.List;

public interface LeavingApplicationDao {
    /**
     * 列出所有请假单
     *
     * @return leavingApplicactionList
     */
    List<LeavingApplication> queryLeavingApplication();

    /**
     * 根据id查询请假单
     *
     * @param leavingApplicationId
     * 传入int类型请假单id
     * @return leavingApplication
     */
    LeavingApplication queryLeavingApplicationById(int leavingApplicationId);

    /**
     * 根据请假员工id查询请假单
     *
     * @param staffId
     * 传入int类型员工id
     * @return leavingApplication
     */
    List<LeavingApplication> queryLeavingApplicationByStaffId(int staffId);

    /**
     * 根据员工姓名查询请假单
     *
     * @param staffName
     * 传入String类型
     * @return leavingApplication
     */
    LeavingApplication queryLeavingApplicationByStaffName(String staffName);

    /**
     * 创建新的请假单
     *
     * @param leavingApplication
     * 传入LeavingApplication类的对象
     * @return 受影响的行数
     */
    int insertLeavingApplication(LeavingApplication leavingApplication);

    /**
     * 更新请假单信息
     *
     * @param leavingApplication
     * 传入leavingApplication类型对象
     * @return 受影响的行数
     */
    int updateLeavingApplication(LeavingApplication leavingApplication);

    /**
     * 删除请假单
     *
     * @param leavingApplicationId
     * 传入int类型请假单id
     * @return 受影响的行数
     */
    int deleteLeavingApplication(int leavingApplicationId);
}
